#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int a, b, k, l;
    int arr[10][10] = { 0 };
    int max = 0;
    while (scanf("%d %d", &a, &b) != EOF)
    {
        for (int i = 0; i < a; i++)
        {
            for (int j = 0; j < b; j++)
            {
                scanf("%d", &arr[i][j]);
                if (max < arr[i][j])
                {
                    max = arr[i][j];
                    k = i + 1, l = j + 1;
                }
            }
        }
        printf("%d %d", k, l);
    }
    return 0;
}